package com.suray.basic.wcs.plc.utils;

public enum PlcDeviceProcess {
    INVALID(-1, "无效"),
    CALL_RGV(999, "调小车"),
    LOCK_HAVE_CARGO(10000, "有货时加锁"),                //提升机口输送线与1楼接驳点共用输送线，需对输送线设备加锁
    LOCK_NO_CARGO(10001, "无货时加锁"),                  //提升机口输送线与1楼接驳点共用输送线，需对输送线设备加锁
    UNLOCK(10010, "解锁"),                              //对应上面加锁的解锁操作
    FORWARD_TRANS_CARGO(10020, "输送线正传"),            //给设备发送指令，长输送线(带移栽机)把货物从这头输送到另一头，正传
    BACK_TRANS_CARGO(10021, "输送线反转"),               //给设备发送指令，长输送线(带移栽机)把货物从这头输送到另一头，反转
    TRANS_PLANTER_UP(10030, "移栽上升"),
    TRANS_PLANTER_DOWN(10031, "移栽下降"),
    ;

    int id;
    String des;

    PlcDeviceProcess(int id, String des) {
        this.id = id;
        this.des = des;
    }

    public static PlcDeviceProcess parseDeviceProcess(int id) {
        for (PlcDeviceProcess value : PlcDeviceProcess.values()) {
            if (value.id == id) {
                return value;
            }
        }

        return INVALID;
    }

    public int getId() {
        return id;
    }

    public String getDes() {
        return des;
    }

    @Override
    public String toString() {
        return des;
    }
}
